Grayscale histogram generation

ABSTRACT

In a graphics processing unit (GPU), receiving an input image comprising an array of pixels. Each pixel having a grayscale value from a range of N grayscale values. For each particular input patch of pixels of a set of input patches partitioning the input image and in parallel for each particular grayscale value the range, counting the number of pixels in the particular input patch having the particular grayscale value. In parallel for each particular input patch of pixels of a set of input patches partitioning the input image, creating an output image patch as an ordered sequence of N pixels, with the color value of the nth pixel in each corresponding output patch representing the count of pixels in the particular input patch having the nth grayscale value. Combining the output image patches into a single composite output image of N pixels, the pixel value of the nth pixel in the single composite output image corresponding to the count of pixels in the input image having the nth grayscale value.

TECHNICAL FIELD

The technology disclosed herein is related to graphics processing.Particular examples relate to generating histograms on graphicsprocessing units (GPUs).

BACKGROUND

A GPU is an electronic subsystem (typically a chipset) designed torapidly process images intended for output to a display device. GPUs areused in embedded systems, mobile phones, personal computers,workstations, digital cameras, game consoles, and other digital systems.The highly parallel structure of the GPU makes it more efficient than ageneral-purpose central processing unit (CPU) for certain tasks.

An image histogram is a typically two-dimensional data structure thatdescribes the number of pixels of an image across a range of colorvalues. Conventionally, the range of color values forms the x-axis, andthe number of pixels forms the y-axis—with darker colors at the lowerx-axis values. A large number of tasks in image processing (for example,thresholding) involve creating a histogram of image color values. Inthresholding, each pixel in an image is replaced with a black pixel ifthe image intensity for the pixel is less than a fixed constant T, or awhite pixel if the image intensity is greater than that constant. Thesesorts of histograms are most often used for tasks like edge detection,color correction, image segmentation, co-occurrence matrices, andblack-and-white image conversion, which can be prerequisites for morecomplex image analysis tasks like object and text recognition.

SUMMARY

The technology described herein includes computer implemented methods,computer program products, and systems to create grayscale histograms ofinput images. In some examples of the technology, a GPU receives aninput image comprising an array of pixels. Each pixel has a grayscalevalue from a range of N grayscale values. For each particular inputpatch of pixels of a set of input patches partitioning the input imageand in parallel for each particular grayscale value the range, the GPUcounts the number of pixels in the particular input patch having theparticular grayscale value. In parallel for each particular input patchof pixels of a set of input patches partitioning the input image, theGPU creates an output image patch as an ordered sequence of N pixels,with the color value of the nth pixel in each corresponding output patchrepresenting the count of pixels in the particular input patch havingthe nth grayscale value. The GPU then combines the output image patchesinto a single composite output image of N pixels, the pixel value of thenth pixel in the single composite output image corresponding to thecount of pixels in the input image having the nth grayscale value.

In some examples for a hierarchical partition of the set of output imagepatches, wherein each hierarchical node has at least two children, theGPU sums from the lowest level to the highest level, each nth pixelvalue. In some such examples, each output image patch is a 16×16 pixelarray and each parent other than the hierarch has four children.

In some examples, the color value of each pixel in an output image patchis formatted in OpenGL RBGA unsigned integral format as a base 256number with “R” as the least significant place, and “A” is the mostsignificant place. In some such examples, “A” is formatted as a base 256complement. In some such examples, each output image patch is a 16×16pixel array.

In some examples, counting the number of pixels, creating thecorresponding output image patch, and combining the output image patchesinto a single composite image is performed on the GPU using one or morefragment shaders.

BRIEF DESCRIPTION OF THE DRAWINGS

FIG. 1 is a block diagram depicting a portion of a simplifiedcommunications and processing architecture of a typical device offeringa graphical user interface (GUI) in accordance with certain exampleexamples.

FIG. 2 is a block diagram illustrating methods to create grayscalehistograms of input images, in accordance with certain examples.

FIG. 3 depicts an input grayscale image, in accordance with certainexamples.

FIG. 4 illustrates an input grayscale image partitioned into input imagepatches, in accordance with certain examples.

FIG. 5 illustrates an output patch pixels and as a histogram, inaccordance with certain examples.

FIG. 6 illustrates two views of a histogram, in accordance with certainexamples.

FIG. 7 illustrates two views of a summing of histograms, in accordancewith certain examples.

FIG. 8 illustrates the next-to-last and last stages of a histogram, inaccordance with certain examples.

FIG. 9 illustrate the last stages of the output image histogram in bothan image and as the histogram represented by the image, in accordancewith certain examples.

FIG. 10 is a block diagram depicting a computing machine and a modules,in accordance with certain examples.

DETAILED DESCRIPTION OF THE EXAMPLES

Traditional methods for calculating histograms are prohibitively timeconsuming when performing image processing on a device with a GPU,particularly with the GPUs typically found in mobile devices. Whilethere are approaches for generating an image histogram using a device'sCPU, such approaches perform poorly on a GPU, for example, requiring 256full scans of the entire input image for a grayscale image. Further,GPUs are typically tailored to processing image data structures, and nothistograms.

Examples of the technology disclosed herein can generate imagehistograms on a GPU, in some instances in a small number O(log N) offast GPU passes—where “O(*)” represents “on the order of” and “N” is thenumber of pixels processes. The results can be made available to otherGPU-implemented processes of the image processing pipeline withouthaving to copy the results between the GPU, CPU, and system memory. Suchcopying is a relatively expensive operation that may introduceundesirable latency in real-time image processing applications.

By using and relying on the methods and systems described herein, thetechnology disclosed herein can create image histograms on a device'sGPU without relying on the device's CPU. As such, the technology may beemployed to perform image processing tasks such as thresholding, edgedetection, color correction, image segmentation, co-occurrence matrices,black-and-white image conversion, and object/text recognition in a waythat makes use of the computing device's resources more efficient.

Example System Architectures

FIG. 1 is a block diagram depicting a portion of a simplifiedcommunications and processing architecture 100 of a typical deviceoffering a graphical user interface (GUI) in accordance with certainexamples. While each element in shown in the architecture is representedby one instance of the element, multiple instances of each can beincluded. While certain aspects of operation of the present technologyare presented in examples related to FIG. 1 to facilitate enablement ofthe claimed invention, additional features of the present technology,also facilitating enablement of the claimed invention, are disclosedelsewhere herein.

In such an architecture 100, a central processing unit (CPU) 110 and agraphics processing unit (GPU) 120 share access to system memory 130 viaa system memory bus 140. The CPU 110 and the GPU 120 communicatemessages and data over a bus 160 that may also connect to otherprocessors, sensors, and interface devices (not shown). Each of CPU 110and GPU 120 include local memory (CPU local memory 122, GPU local memory112). Local memory can include cache memory. Cache memory stores data(or instructions, or both) so that future requests for that data can beserved faster; the data stored in a cache might be the result of anearlier computation or a copy of data stored elsewhere. A cache hitoccurs when the requested data can be found in a cache, while a cachemiss occurs when it cannot. Cache hits are served by reading data fromthe cache, which typically is faster than recomputing a result orreading from a slower data store such as system memory 130 or transferbetween the CPU 110 and GPU 120. Thus, the more requests that can beserved from the cache, the faster the system performs. The GPU 120typically operates on data from local memory to drive display subsystem140. Throughout the discussion of examples, it should be understood thatthe terms “data” and “information” are used interchangeably herein torefer to text, images, audio, video, or any other form of informationthat can exist in a computer-based environment.

The architecture 100 illustrated is an example, and other means ofestablishing a communications link between the functional blocks can beused. Moreover, those having ordinary skill in the art having thebenefit of the present disclosure will appreciate that the elementsillustrated in FIG. 1 may have any of several other suitable computersystem configurations. For example, the architecture 100 may be embodiedas a mobile phone or handheld computer and may not include all thecomponents described above.

In examples the technology presented herein may be part of any type ofcomputing machine such as, but not limited to, those discussed in moredetail with respect to FIG. 10. Furthermore, any modules associated withany of these computing machines, such as modules described herein or anyother modules (scripts, web content, software, firmware, or hardware)associated with the technology presented herein may be any of themodules discussed in more detail with respect to FIG. 10. The computingmachines discussed herein may communicate with one another as well asother computer machines or communication systems over one or morenetworks. The network may include any type of data or communicationsnetwork, including any of the network technology discussed with respectto FIG. 10.

Example Processes

The example methods illustrated in the figures are described hereinafterwith respect to the components of the example architecture 100. Theexample methods also can be performed with other systems and in otherarchitectures. The operations described with respect to any of thefigures can be implemented as executable code stored on a computer ormachine readable non-transitory tangible storage medium (e.g., floppydisk, hard disk, ROM, EEPROM, nonvolatile RAM, CD-ROM, etc.) that arecompleted based on execution of the code by a processor circuitimplemented using one or more integrated circuits; the operationsdescribed herein also can be implemented as executable logic that isencoded in one or more non-transitory tangible media for execution(e.g., programmable logic arrays or devices, field programmable gatearrays, programmable array logic, application specific integratedcircuits, etc.).

Referring to FIG. 2, and continuing to refer to FIG. 1 for context,methods 200 to create image histograms are illustrated in accordancewith certain examples. In such methods 200, a GPU 110 receives an inputimage—Block 210. The input image is composed of a two-dimensional arrayof pixel color values. For example, the color of a pixel can berepresented by a vector having components for red, blue, and green colorintensities of the pixel. Examples disclosed herein operated on inputimages of the OpenGL® “RGBA” format, but are not restricted to thatformat. OpenGL is a cross-language, cross-platform applicationprogramming interface (API) for rendering graphics. The API is typicallyused to interact with a GPU 110 to achieve hardware-acceleratedrendering. OpenGL enables the use of programs called “shaders” tomanipulated images. In addition to 8-bit values for each of red, green,and blue, the OpenGL RGBA format uses an 8-bit “A,” or “alpha,”component. The 8-bit format provides 256 discrete values from “0” to“255” for each pixel. The alpha component is typically used to representthe transparency of a pixel.

In OpenGL, color values can be stored in one of three ways: normalizedintegers, floating-point, or integral. Both normalized integer andfloating-point formats will resolve, in a shader, to a vector offloating-point values; whereas integral formats will resolve to a vectorof integers. Examples presented herein use the integral format for eachof “R,” “B,” “G,” and “A.” While the OpenGL RGBA format can representvirtually any color of pixel, examples disclosed herein operate on“grayscale” images. In the OpenGL RGBA format, grayscale pixel valuesare represented by R=B=G, with any applicable A. For example, the pixelvalue (127, 127, 127, 255) represents a solid (A=max, solid) mediumgray, the pixel value (0, 0, 0, 255) represents solid black, and thepixel value (255, 255, 255, 255) represents solid white.

Referring to FIG. 3, and continuing to refer to prior figures forcontext, an input grayscale image 300 is shown, in accordance withcertain examples. In a continuing example, consider the 64 pixel high×76pixel wide grayscale image 300 of FIG. 3. The image 300 consists of apattern of vertical stripes—4 pixels wide of solid HTML black (0, 0, 0,255) 320, 4 pixels wide of solid HTML white (255, 255, 255, 255) 330, 4pixels wide of solid HTML silver (192, 192, 192, 255) 340, and 4 pixelswide of solid HTML gray (128, 128, 128, 255) 350. Note that this (black320, white 330, silver 340, and gray 350) pattern repeats four fulltimes, and then only the black 320, white 330, and silver 340 stripesrepeat one additional time. As a result, there are (64×4×5)=1280 blackpixels, 1280 white pixels, and 1280 silver pixels—but only (64×4×4)=1024gray pixels.

For each particular input patch of pixels of a set of input patchespartitioning the input image, and in parallel for each particulargrayscale value the range, the GPU 110 counts the number of pixels inthe particular input patch having the particular grayscale value—Block220. TABLE 1 presents example pseudocode for performing this count.

TABLE 1 // Iterate over every pixel in the patch. for x inrange(start_x_pixel, end_x_pixel) for y in range(start_y_pixel,end_y_pixel) color = SampleColor(x, y) gray_level =ToGrayscaleIntValue(color) if (my_gray_level == gray_level) {my_pixel_count = my_pixel_count + 1 } }EmitColor(CountToColor(my_pixel_count))

Referring to FIG. 4, and continuing to refer to prior figures forcontext, the input grayscale image is shown partitioned into input imagepatches 410 and 420, in accordance with certain examples. In thecontinuing example, as shown in FIG. 4, 16 pixel×16 pixel input imagepatches are used as a basis. Each of four rows of such input imagepatches includes four full input image patches 410 and one 16 pixelhigh×12 pixel wide final input image patch 420. In some examples,uniformly dimensioned input image patches are used throughout withoutsubstantial changes to the technology.

The GPU uses OpenGL shaders to count the number of pixels of each of 256grayscale values in each input patch. In the continuing example, all ofthe input patches have the same number of black, white and silverpixels—64. Sixteen of the twenty patches have 64 gray pixels, while theremaining four final input patches 420 have no gray pixels.

In parallel for each particular input patch of pixels of the set ofinput patches partitioning the input image, the shaders running on theGPU 110 create an output image patch as an ordered sequence of N pixels,with the color value of the nth pixel in each corresponding output patchrepresenting the count of pixels in the particular input patch havingthe nth grayscale value—Block 230. In the continuing example, N=256—thenumber of different grayscale values in the OpenGL RBGA scheme.

It is important to note that the position of a pixel in a 16 pixel×16pixel output image patch corresponds to a color in the OpenGL RBGAgrayscale scheme. The value of the color of a given output image patchpixel corresponds to the count of pixels of that color in the inputimage. Note that a transformation has taken place—position in the outputimage patch corresponds to grayscale color, and color in the outputimage patch corresponds to count of input patch pixels of that grayscalecolor. Further, each output patch, including the output patchescorresponding to 16 pixel×12 pixel input patches, is 16 pixels×16pixels.

The shaders running on GPU 110 format the color value of each pixel ineach output image patch in OpenGL RBGA unsigned integral format as abase 256 number with “R” as the least significant place, and “A” is themost significant place. However, to facilitate the use of the resultingoutput images in troubleshooting, the “A” place is formatted as the base256 complement of its actual value in the count. Otherwise, in a typicaluse of “A,” given that the “A” place is the most significant in theoutput image patch coding scheme, “A” will equal “0” (transparent) untilwell over 16,000,000 pixels of a given grayscale color are counted.

Referring to FIG. 5, and continuing to refer to prior figures forcontext, an output patch 500 is shown as pixels 510 (i,j), wheren=(i−1)*16+j, and as a histogram 520, in accordance with examples of thepresent technology. In the output patch, the nth=1^(st) pixel—(0, 0, 0,0) in four-place base 256 notation—corresponds to the 1^(st) grayscalevalue (0, 0, 0, 255=complement₂₅₆ (0)) —black.

In the continuing example, there are 64 pixels of the input image withthe color value (0, 0, 0, 255)=black. The GPU sets the color value ofthe 1^(st) pixel in the output patch (an output patch position of the1^(st) pixel in the 1^(st) row corresponding to black) to (64, 0, 0,255) —a shade of red. There are 64 pixels of the input image with thecolor value (255, 255, 255, 255)=white. The GPU sets the color value ofthe 256^(st) pixel in the output patch (an output patch positioncorresponding to white) to (64, 0, 0, 255) —as with the first pixel, thesame shade of red. There are 64 pixels of the input image with the colorvalue (192, 192, 192, 255)=silver. The GPU sets the color value of the193^(rd) pixel (the last pixel in the 12^(th) row of the output imagepatch) in the output patch (an output patch position corresponding tosilver) to (64, 0, 0, 255) —as with the first and second pixels, a shadeof red. And finally, there are 64 pixels of the input image with thecolor value (128, 128, 128, 255)=gray. The GPU sets the color value ofthe 129^(rd) pixel (the last pixel in the 12^(th) row of the outputimage patch) in the output patch (an output patch position correspondingto silver) to (64, 0, 0, 255) —as with the previous pixels, a shade ofred. Note that the width of each histogram column has been lightlyexaggerated for visibility.

After representing the grayscale histograms for each input patch as anoutput patch as described above, the GPU combines the output imagepatches into a single composite output image of N pixels—Block 240. Thepixel value of the nth pixel in the single composite output imagecorresponding to the count of pixels in the input image having the nthgrayscale value.

In the continuing example, for a hierarchical partition of the set ofoutput image patches, wherein each hierarchical node has at least twochildren, the GPU sums, from the lowest level to the highest level, eachnth pixel value. Referring to FIG. 6 and continuing to refer to priorfigures for context, two views 610, 620 of a histogram 600 are shown, inaccordance with examples of the present technology. In the continuingexample, consider pixel #1 in each of output image patches 510 a, 510 b,510 c, and 510 d. Each has the value (64, 0, 0, 255) or 64₂₅₆ (since the“R” place is the least significant base₂₅₆ place. The GPU sums the colorvalues of each 510 #1 pixel from output image patches 510 a, 510 b, 510c, and 510 d—giving 256, or in the notation of the present technology(0, 1, 0, 255), a very dark green. Histogram 620 reflects this count inthe first histogram bar from the left. The GPU sums remaining groups ofcorresponding pixels from patches 510 a, 510 b, 510 c, and 510 d,resulting in the remaining bars shown in histogram 620. The GPU performsa parallel accumulation for output image patch sets {510 e, 510 f, 510g, 510 h}, {510 i, 510 j, 510 k, 5101}, and {510 m, 510 n, 510 o, 510p}. The summing converts the digits to integers, adds the integers withcarry, and then converts the integers back into floating point.

Though as can be seen in FIG. 7, each of {510 q, 510 r, 510 s, 510 t}shows no count at pixel 714 (corresponding to gray) —as opposed to thevalue (64, 0, 0, 255) at pixel 712 in output patch 510 p. The missingbar at grayscale value 129 in the corresponding histogram 720 is anotherview of the results of accumulating corresponding pixel counts from 16pixel×16 pixel output patches {510 q, 510 r, 510 s, 510 t}.

Referring to FIG. 8, and continuing to refer to prior figures forcontext, 800 illustrates the next-to-last 810 and last 820 stages of ahistogram, in accordance with examples of the present technology. Afterthe processes described in connection with FIG. 6 and FIG. 7 have beencompleted, the GPU is storing five (5) 16 pixel×16 pixel patches, thatthe GPU sums in a pixel by pixel fashion to form histogram 820.Referring to FIG. 9, and continuing to refer to prior figures forcontext, 900 illustrates the last stages of the output image histogramin both an image and as the histogram represented by the image. In thecontinuing example, the 16 pixel×16 pixel output image patch 910represents the same histogram of the original complete grayscale inputimage 300. The GPU assigns the pixels corresponding to black, silver,and white color values reflecting the count of each such color pixelfrom the original grayscale input image 300—the blue color value (0, 5,0, 255), corresponding to the count 1280. The GPU assigns the pixelcorresponding to the gray color value reflecting the count of each graypixels from the original grayscale input image 300—the blue color value(0, 4, 0, 255), corresponding to the count 1024.

Other Examples

FIG. 10 depicts a computing machine 2000 and a module 2050 in accordancewith certain examples. The computing machine 2000 may correspond to anyof the various computers, servers, mobile devices, embedded systems, orcomputing systems presented herein. The module 2050 may comprise one ormore hardware or software elements configured to facilitate thecomputing machine 2000 in performing the various methods and processingfunctions presented herein. The computing machine 2000 may includevarious internal or attached components such as a processor 2010, systembus 2020, system memory 2030, storage media 2040, input/output interface2060, and a network interface 2070 for communicating with a network2080.

The computing machine 2000 may be implemented as a conventional computersystem, an embedded controller, a laptop, a server, a mobile device, asmartphone, a set-top box, a kiosk, a router or other network node, avehicular information system, one or more processors associated with atelevision, a customized machine, any other hardware platform, or anycombination or multiplicity thereof. The computing machine 2000 may be adistributed system configured to function using multiple computingmachines interconnected via a data network or bus system.

The processor 2010 may be configured to execute code or instructions toperform the operations and functionality described herein, managerequest flow and address mappings, and to perform calculations andgenerate commands. The processor 2010 may be configured to monitor andcontrol the operation of the components in the computing machine 2000.The processor 2010 may be a general purpose processor, a processor core,a multiprocessor, a reconfigurable processor, a microcontroller, adigital signal processor (“DSP”), an application specific integratedcircuit (“ASIC”), a graphics processing unit (“GPU”), a fieldprogrammable gate array (“FPGA”), a programmable logic device (“PLD”), acontroller, a state machine, gated logic, discrete hardware components,any other processing unit, or any combination or multiplicity thereof.The processor 2010 may be a single processing unit, multiple processingunits, a single processing core, multiple processing cores, specialpurpose processing cores, co-processors, or any combination thereof.According to certain examples, the processor 2010 along with othercomponents of the computing machine 2000 may be a virtualized computingmachine executing within one or more other computing machines.

The system memory 2030 may include non-volatile memories such asread-only memory (“ROM”), programmable read-only memory (“PROM”),erasable programmable read-only memory (“EPROM”), flash memory, or anyother device capable of storing program instructions or data with orwithout applied power. The system memory 2030 may also include volatilememories such as random access memory (“RAM”), static random accessmemory (“SRAM”), dynamic random access memory (“DRAM”), and synchronousdynamic random access memory (“SDRAM”). Other types of RAM also may beused to implement the system memory 2030. The system memory 2030 may beimplemented using a single memory module or multiple memory modules.While the system memory 2030 is depicted as being part of the computingmachine 2000, one skilled in the art will recognize that the systemmemory 2030 may be separate from the computing machine 2000 withoutdeparting from the scope of the subject technology. It should also beappreciated that the system memory 2030 may include, or operate inconjunction with, a non-volatile storage device such as the storagemedia 2040.

The storage media 2040 may include a hard disk, a floppy disk, a compactdisc read only memory (“CD-ROM”), a digital versatile disc (“DVD”), aBlu-ray disc, a magnetic tape, a flash memory, other non-volatile memorydevice, a solid state drive (“SSD”), any magnetic storage device, anyoptical storage device, any electrical storage device, any semiconductorstorage device, any physical-based storage device, any other datastorage device, or any combination or multiplicity thereof. The storagemedia 2040 may store one or more operating systems, application programsand program modules such as module 2050, data, or any other information.The storage media 2040 may be part of, or connected to, the computingmachine 2000. The storage media 2040 may also be part of one or moreother computing machines that are in communication with the computingmachine 2000 such as servers, database servers, cloud storage, networkattached storage, and so forth.

The module 2050 may comprise one or more hardware or software elementsconfigured to facilitate the computing machine 2000 with performing thevarious methods and processing functions presented herein. The module2050 may include one or more sequences of instructions stored assoftware or firmware in association with the system memory 2030, thestorage media 2040, or both. The storage media 2040 may thereforerepresent examples of machine or computer readable media on whichinstructions or code may be stored for execution by the processor 2010.Machine or computer readable media may generally refer to any medium ormedia used to provide instructions to the processor 2010. Such machineor computer readable media associated with the module 2050 may comprisea computer software product. It should be appreciated that a computersoftware product comprising the module 2050 may also be associated withone or more processes or methods for delivering the module 2050 to thecomputing machine 2000 via the network 2080, any signal-bearing medium,or any other communication or delivery technology. The module 2050 mayalso comprise hardware circuits or information for configuring hardwarecircuits such as microcode or configuration information for an FPGA orother PLD.

The input/output (“I/O”) interface 2060 may be configured to couple toone or more external devices, to receive data from the one or moreexternal devices, and to send data to the one or more external devices.Such external devices along with the various internal devices may alsobe known as peripheral devices. The I/O interface 2060 may include bothelectrical and physical connections for operably coupling the variousperipheral devices to the computing machine 2000 or the processor 2010.The I/O interface 2060 may be configured to communicate data, addresses,and control signals between the peripheral devices, the computingmachine 2000, or the processor 2010. The I/O interface 2060 may beconfigured to implement any standard interface, such as small computersystem interface (“SCSI”), serial-attached SCSI (“SAS”), fiber channel,peripheral component interconnect (“PCP”), PCI express (PCIe), serialbus, parallel bus, advanced technology attached (“ATA”), serial ATA(“SATA”), universal serial bus (“USB”), Thunderbolt, FireWire, variousvideo buses, and the like. The I/O interface 2060 may be configured toimplement only one interface or bus technology. Alternatively, the I/Ointerface 2060 may be configured to implement multiple interfaces or bustechnologies. The I/O interface 2060 may be configured as part of, allof, or to operate in conjunction with, the system bus 2020. The I/Ointerface 2060 may include one or more buffers for bufferingtransmissions between one or more external devices, internal devices,the computing machine 2000, or the processor 2010.

The I/O interface 2060 may couple the computing machine 2000 to variousinput devices including mice, touch-screens, scanners, electronicdigitizers, sensors, receivers, touchpads, trackballs, cameras,microphones, keyboards, any other pointing devices, or any combinationsthereof. The I/O interface 2060 may couple the computing machine 2000 tovarious output devices including video displays, speakers, printers,projectors, tactile feedback devices, automation control, roboticcomponents, actuators, motors, fans, solenoids, valves, pumps,transmitters, signal emitters, lights, and so forth.

The computing machine 2000 may operate in a networked environment usinglogical connections through the network interface 2070 to one or moreother systems or computing machines across the network 2080. The network2080 may include wide area networks (WAN), local area networks (LAN),intranets, the Internet, wireless access networks, wired networks,mobile networks, telephone networks, optical networks, or combinationsthereof. The network 2080 may be packet switched, circuit switched, ofany topology, and may use any communication protocol. Communicationlinks within the network 2080 may involve various digital or an analogcommunication media such as fiber optic cables, free-space optics,waveguides, electrical conductors, wireless links, antennas,radio-frequency communications, and so forth.

The processor 2010 may be connected to the other elements of thecomputing machine 2000 or the various peripherals discussed hereinthrough the system bus 2020. It should be appreciated that the systembus 2020 may be within the processor 2010, outside the processor 2010,or both. According to certain examples, any of the processor 2010, theother elements of the computing machine 2000, or the various peripheralsdiscussed herein may be integrated into a single device such as a systemon chip (“SOC”), system on package (“SOP”), or ASIC device.

Examples may comprise a computer program that embodies the functionsdescribed and illustrated herein, wherein the computer program isimplemented in a computer system that comprises instructions stored in amachine-readable medium and a processor that executes the instructions.However, it should be apparent that there could be many different waysof implementing examples in computer programming, and the examplesshould not be construed as limited to any one set of computer programinstructions. Further, a skilled programmer would be able to write sucha computer program to implement an example of the disclosed examplesbased on the appended flow charts and associated description in theapplication text. Therefore, disclosure of a particular set of programcode instructions is not considered necessary for an adequateunderstanding of how to make and use examples. Further, those skilled inthe art will appreciate that one or more aspects of examples describedherein may be performed by hardware, software, or a combination thereof,as may be embodied in one or more computing systems. Moreover, anyreference to an act being performed by a computer should not beconstrued as being performed by a single computer as more than onecomputer may perform the act.

The examples described herein can be used with computer hardware andsoftware that perform the methods and processing functions describedherein. The systems, methods, and procedures described herein can beembodied in a programmable computer, computer-executable software, ordigital circuitry. The software can be stored on computer-readablemedia. For example, computer-readable media can include a floppy disk,RAM, ROM, hard disk, removable media, flash memory, memory stick,optical media, magneto-optical media, CD-ROM, etc. Digital circuitry caninclude integrated circuits, gate arrays, building block logic, fieldprogrammable gate arrays (FPGA), etc.

The example systems, methods, and acts described in the examplespresented previously are illustrative, and, in alternative examples,certain acts can be performed in a different order, in parallel with oneanother, omitted entirely, and/or combined between different examples,and/or certain additional acts can be performed, without departing fromthe scope and spirit of various examples. Accordingly, such alternativeexamples are included in the scope of the following claims, which are tobe accorded the broadest interpretation to encompass such alternateexamples.

Although specific examples have been described above in detail, thedescription is merely for purposes of illustration. It should beappreciated, therefore, that many aspects described above are notintended as required or essential elements unless explicitly statedotherwise. Modifications of, and equivalent components or actscorresponding to, the disclosed aspects of the examples, in addition tothose described above, can be made by a person of ordinary skill in theart, having the benefit of the present disclosure, without departingfrom the spirit and scope of examples defined in the following claims,the scope of which is to be accorded the broadest interpretation so asto encompass such modifications and equivalent structures.

1. A computer-implemented method to create grayscale histograms of inputimages, comprising: in a graphics processing unit (GPU): receiving aninput image comprising an array of pixels, each pixel having a grayscalevalue from a range of N grayscale values; for each particular inputpatch of pixels of a set of input patches partitioning the input image:in parallel for each particular grayscale value in the range, countingthe number of pixels in the particular input patch having the particulargrayscale value; and creating an output image patch as an orderedsequence of N pixels, with the color value of the nth pixel in eachcorresponding output patch representing the count of pixels in theparticular input patch having the nth grayscale value; and combining theoutput image patches into a single composite output image of N pixels,the pixel value of the nth pixel in the single composite output imagecorresponding to the count of pixels in the input image having the nthgrayscale value.
 2. The method of claim 1, wherein combining the outputimage patches into a single composite output image comprises: for ahierarchical partition of the set of output image patches, wherein eachhierarchical node has at least two children, summing, from the lowestlevel to the highest level, each nth pixel value.
 3. The method of claim2, wherein each output image patch is a 16×16 pixel array and eachparent other than the hierarch has four children.
 4. The method of claim1, wherein the color value of each pixel in an output image patch isformatted in OpenGL RBGA unsigned integral format as a base 256 numberwith “R” as the least significant place, and “A” is the most significantplace.
 5. The method of claim 4, wherein “A” is formatted as a base 256complement.
 6. The method of claim 4, wherein each output image patch isa 16×16 pixel array.
 7. The method of claim 1, wherein counting thenumber of pixels, creating the corresponding output image patch, andcombining the output image patches into a single composite image isperformed on the GPU using one or more fragment shaders.
 8. A computerprogram product, comprising: a non-transitory computer-readable storagedevice having computer-executable program instructions embodied thereonthat when executed by a computer cause the computer to create grayscalehistograms of input images: in a graphics processing unit (GPU): receivean input image comprising an array of pixels, each pixel having agrayscale value from a range of N grayscale values; for each particularinput patch of pixels of a set of input patches partitioning the inputimage: in parallel for each particular grayscale value the range, countthe number of pixels in the particular input patch having the particulargrayscale value; and create an output image patch as an ordered sequenceof N pixels, with the color value of the nth pixel in each correspondingoutput patch representing the count of pixels in the particular inputpatch having the nth grayscale value; and combine the output imagepatches into a single composite output image of N pixels, the pixelvalue of the nth pixel in the single composite output imagecorresponding to the count of pixels in the input image having the nthgrayscale value.
 9. The computer program product of claim 8, whereincombining the output image patches into a single composite output imagecomprises: for a hierarchical partition of the set of output imagepatches, wherein each hierarchical node has at least two children,summing, from the lowest level to the highest level, each nth pixelvalue.
 10. The computer program product of claim 9, wherein each outputimage patch is a 16×16 pixel array and each parent other than thehierarch has four children.
 11. The computer program product of claim 8,wherein the color value of each pixel in an output image patch isformatted in OpenGL RBGA unsigned integral format as a base 256 numberwith “R” as the least significant place, and “A” is the most significantplace.
 12. The computer program product of claim 11, wherein “A” isformatted as a base 256 complement.
 13. The computer program product ofclaim 11, wherein each output image patch is a 16×16 pixel array. 14.The computer program product of claim 8, wherein counting the number ofpixels, creating the corresponding output image patch, and combining theoutput image patches into a single composite image is performed on theGPU using one or more fragment shaders.
 15. A system to process aregistration of a user in a mobile payment service being one of aplurality of services supported by a service provider, comprising: astorage device; and a processor communicatively coupled to the storagedevice, wherein the processor executes application code instructionsthat are stored in the storage device to cause the system to: in agraphics processing unit (GPU): receive an input image comprising anarray of pixels, each pixel having a grayscale value from a range of Ngrayscale values; for each particular input patch of pixels of a set ofinput patches partitioning the input image: in parallel for eachparticular grayscale value the range, count the number of pixels in theparticular input patch having the particular grayscale value; and createan output image patch as an ordered sequence of N pixels, with the colorvalue of the nth pixel in each corresponding output patch representingthe count of pixels in the particular input patch having the nthgrayscale value; and combine the output image patches into a singlecomposite output image of N pixels, the pixel value of the nth pixel inthe single composite output image corresponding to the count of pixelsin the input image having the nth grayscale value.
 16. The system ofclaim 15, wherein combining the output image patches into a singlecomposite output image comprises: for a hierarchical partition of theset of output image patches, wherein each hierarchical node has at leasttwo children, summing, from the lowest level to the highest level, eachnth pixel value.
 17. The system of claim 16, wherein each output imagepatch is a 16×16 pixel array and each parent other than the hierarch hasfour children.
 18. The system of claim 15, wherein the color value ofeach pixel in an output image patch is formatted in OpenGL RBGA unsignedintegral format as a base 256 number with “R” as the least significantplace, and “A” is the most significant place.
 19. The system of claim18, wherein “A” is formatted as a base 256 complement.
 20. The system ofclaim 18, wherein each output image patch is a 16×16 pixel array.